Skip to content

feat(enrichment): treat Zstandard (.zst) archives as binary assets - #3128

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix/asset-weight-zstandard
Jul 4, 2026
Merged

feat(enrichment): treat Zstandard (.zst) archives as binary assets#3128
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:fix/asset-weight-zstandard

Conversation

@davion-knight

@davion-knight davion-knight commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The asset-weight analyzer flags heavy binary blobs whose byte sizes never appear in the textual diff (they show as "Binary files differ"). Its extension set already covers the common archive/compression formats gz / tgz / bz2 / xz / 7z / rar, but missed Zstandard (.zst) — now a routinely-committed artifact (npm/cargo caches, CI caches, compressed model shards). A PR that added or grew a large .zst blob therefore slipped past the size-bloat signal.

This adds "zst" to BINARY_EXTS:

  • Only the final extension is matched, so a compound name like foo.tar.zst correctly resolves to zst.
  • The lookup stays case-insensitive (existing toLowerCase() path), so .ZST is covered.
  • Text formats (svg/json/…) remain excluded — their bytes are already in the diff.
  • Additive-only: one entry in the set plus test cases; no existing behavior changes.

Consistency anchor: src/review/rag.ts's BINARY_EXT_RE already classifies .zst as binary, so the repo already treats .zst as a binary asset — this brings the size analyzer in line with that existing decision.

No linked issue

This is a no-issue PR by design: a self-contained detection-coverage improvement that adds one archive extension (.zst) to the asset-weight analyzer's BINARY_EXTS set plus its unit test, touching only review-enrichment/. There is no behavior change beyond recognizing the new extension, so no tracking issue is needed. It mirrors the accepted no-issue precedent for the very same file — webp/avif/heic/heif (e.g. #3089).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • No linked issue — a self-contained detection-coverage improvement touching only asset-weight.ts and its unit test, mirroring the accepted precedent for webp/avif/heic/heif. The summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage — no src/** lines changed (this change is under review-enrichment/, which Codecov does not measure), so codecov/patch has no diff to gate; suite is green.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New behavior has tests — the .zst positive, compound .tar.zst, and uppercase .ZST cases are added to the isBinaryAsset unit test; npm run rees:test passes (all review-enrichment tests green, analyzer-metadata check clean).

All of the above run as part of npm run test:ci (green).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • No auth, cookie, CORS, GitHub App, Cloudflare, or session changes (N/A — pure extension-set addition).
  • No API/OpenAPI/MCP behavior change (N/A).
  • No UI changes (N/A — this is a review-enrichment analyzer).
  • No visible UI change, so no UI Evidence section is required.
  • No docs/changelog changes needed.

Notes

Analogues followed end-to-end: the merged feat(enrichment): treat HEIC/HEIF images as binary assets (#3089) and the original asset-weight analyzer (#1621) — same file, same additive shape, same test pattern.

@davion-knight
davion-knight requested a review from JSONbored as a code owner July 4, 2026 15:43
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 18:16:51 UTC

2 files · 1 AI reviewer · no blockers · readiness 73/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change correctly adds `.zst` to the asset-weight binary extension set and covers the real lookup behavior through `isBinaryAsset`: final-extension matching via `lastIndexOf('.')` and case-insensitivity via `toLowerCase()`. The implementation is additive, aligns the analyzer with the existing archive/compression treatment, and the tests exercise the actual helper path rather than a fabricated payload.

Nits — 3 non-blocking
  • nit: `review-enrichment/test/asset-weight.test.ts:25` puts several behavior claims into a long inline comment; the assertions already prove those claims, so this can be shortened to keep the test focused.
  • `review-enrichment/test/asset-weight.test.ts:25`: consider shortening the new comment to `// Zstandard blobs are binary compressed assets; compound names still match the final extension.`
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 21 registered-repo PR(s), 14 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 21 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 21 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

The asset-weight analyzer flags heavy binary blobs whose sizes are not in
the textual diff, but its archive/compression extension set covered
gz/tgz/bz2/xz/7z/rar and missed Zstandard (.zst) — now a common committed
artifact (npm/cargo caches, compressed model shards). Add it so a PR that
commits a large .zst blob is weighed like other binary archives.

Only the final extension is matched, so a compound name like `.tar.zst`
resolves to `zst`, and the lookup stays case-insensitive. src/review/rag.ts
already classifies .zst as binary; this brings the size analyzer in line.
@JSONbored
JSONbored force-pushed the fix/asset-weight-zstandard branch from c88ae77 to 67b78a9 Compare July 4, 2026 18:17
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jul 4, 2026

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit f90fba7 into JSONbored:main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant